/*
 * Design by  free.wang <freefis@gmail.com>
 * Licence unser BSD  lisence
 * Complete on May 30 21:30 , 2009 
 *
 * Environment:
 *     GCC 4.3.2
 *     Ubuntu / Linux i386
 *     Mac OS X / FreeBSD 4.x
 */
#include "random.h"
 

/* time.ctime() in Python */
char *currenttime()
{
	time_t timep;
	time(&timep);
	return ctime(&timep);	
}

/* time.time() in Python */
int totalsecond()
{
	time_t timep;
	time(&timep);
	return  (unsigned)time(&timep);
}


/* randint in Python */
int randint(int ButtonLimit,int TopLimit)
{
    srand((unsigned)time(NULL)+rand());
	return ( rand()%(TopLimit-ButtonLimit+1)+ButtonLimit );
}
